package com.battery.system.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.battery.common.annotation.Excel;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 账号对象 ws_proxy_user
 *
 * @author battery
 * @date 2021-01-20
 */
@Table(name = "ws_proxy_user")
public class ProxyUser {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @KeySql(useGeneratedKeys = true)
    private String id;

    /**
     * 登录手机号
     */
    @Excel(name = "登录手机号")
    private String phone;


    private String trueName;

    /**
     * 密码
     */
    @Excel(name = "密码")
    private String password;

    /**
     * shiro加密盐
     */
    @Excel(name = "shiro加密盐")
    private String salt;

    /**
     * 账号类型 1 平台 2 合作商 3 商户
     */
    @Excel(name = "账号类型 1 平台 2 合作商 3 商户")
    private Integer accountType;

    /**
     * 账号对应的ID
     */
    @Excel(name = "账号对应的ID")
    private String accountId;

    /**
     * 是否员工 0 否 1 是
     */
    @Excel(name = "是否员工 0 否 1 是")
    private Integer isStaff;

    /**
     * 是否禁用账号 0 正常 1 禁用
     */
    @Excel(name = "是否禁用账号 0 正常 1 禁用")
    private Integer isBan;

    /**
     * 禁用描述
     */
    @Excel(name = "禁用描述")
    private String banDesc;

    /**
     * 最后登陆时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastLoginTime;

    /**
     * 0 未删除 1 已删除
     */
    @Excel(name = "0 未删除 1 已删除")
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;


    @Transient
    private Integer isTopLevel;

    public Integer getIsTopLevel() {
        return isTopLevel;
    }

    public void setIsTopLevel(Integer isTopLevel) {
        this.isTopLevel = isTopLevel;
    }


    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getSalt() {
        return salt;
    }

    public Integer getAccountType() {
        return accountType;
    }

    public void setAccountType(Integer accountType) {
        this.accountType = accountType;
    }

    public void setAccountId(String accountId) {
        this.accountId = accountId;
    }

    public String getAccountId() {
        return accountId;
    }

    public void setIsStaff(Integer isStaff) {
        this.isStaff = isStaff;
    }

    public Integer getIsStaff() {
        return isStaff;
    }

    public void setIsBan(Integer isBan) {
        this.isBan = isBan;
    }

    public Integer getIsBan() {
        return isBan;
    }

    public void setBanDesc(String banDesc) {
        this.banDesc = banDesc;
    }

    public String getBanDesc() {
        return banDesc;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }


    public String getTrueName() {
        return trueName;
    }

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("phone", getPhone())
                .append("password", getPassword())
                .append("salt", getSalt())
                .append("accountType", getAccountType())
                .append("accountId", getAccountId())
                .append("isStaff", getIsStaff())
                .append("isBan", getIsBan())
                .append("banDesc", getBanDesc())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("lastLoginTime", getLastLoginTime())
                .append("isDeleted", getIsDeleted())
                .toString();
    }
}
